import Vue from 'vue'
import Router from 'vue-router'

//导入需要注册路由的组件
import Home from "../components/Home"
import Login from "../components/Login";
import Register from "../components/Register";
import FindPassword from "../components/FindPassword";
import ResetPassword from "../components/ResetPassword";
import MobileReset from "../components/MobileReset";
import QQCallBack from "../components/QQCallBack";
import Write from "../components/Write";
import Writed from "../components/Writed";
import Wallet from "../components/Wallet";
import Article from "../components/Article";
import Search from "../components/Search";
import Chat from "../components/Chat";
import ChatList from "../components/ChatList";

Vue.use(Router);

export default new Router({
  mode: "history",
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home
    },
    {
      path: '/home',
      name: 'Home',
      component: Home
    },
    {
      path: '/user/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/user/register',
      name: 'Register',
      component: Register,
    },
    {
      path: '/email_reset',
      name: 'FindPassword',
      component: FindPassword,
    },
    {
      path: '/reset_password',
      name: 'ResetPassword',
      component: ResetPassword,
    },
    {
      path: '/mobile_reset',
      name: 'MobileReset',
      component: MobileReset,
    },
    {
       name:"QQCallBack",
       path:"/oauth_callback.html",
       component: QQCallBack,
     },
    {
       name:"Write",
       path:"/writer",
       component: Write,
     },
    {
       name:"Writed",
       path:"/:id/writed",
       component: Writed,
     },
    {
       name:"Wallet",
       path:"/user/wallet",
       component: Wallet,
     },
    {
       name:"Search",
       path:"/search",
       component: Search,
     },
    {
       name:"Article",
       path:"/article/:id",
       component: Article,
     },
    {
       name:"Chat",
       path:"/chat/:chat_id",
       component: Chat,
     },
    {
       name:"ChatList",
       path:"/chat",
       component: Chat,
     },
  ]
})
